Skip to content

refactor: centralize pool active check into is_pool_active helper#453

Merged
Yunusabdul38 merged 4 commits intoWeb3Novalabs:mainfrom
CollinsC1O:is_pool_active_helper
Mar 27, 2026
Merged

refactor: centralize pool active check into is_pool_active helper#453
Yunusabdul38 merged 4 commits intoWeb3Novalabs:mainfrom
CollinsC1O:is_pool_active_helper

Conversation

@CollinsC1O
Copy link
Copy Markdown
Contributor

Summary

Closes #386

Adds a private is_pool_active helper function to centralize the repeated
pool state check (resolved == false && canceled == false && state == Active)
that was scattered across lib.rs.

Changes

  • Added is_pool_active(pool: &Pool) -> bool helper in the pure functions section of lib.rs
  • Replaced manual checks in place_prediction, resolve_pool, cancel_pool,
    oracle_resolve, and increase_max_total_stake with calls to the helper
  • Added 7 unit tests covering the helper across all affected functions

Notes

Existing panic messages ("Pool already resolved", "Cannot place prediction on canceled pool")
are preserved to avoid breaking existing tests. This is a pure refactor — no behavior changes.

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 24, 2026

Someone is attempting to deploy a commit to the shola's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 24, 2026

@CollinsC1O Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Yunusabdul38
Copy link
Copy Markdown
Collaborator

@CollinsC1O fix ci error

@Yunusabdul38 Yunusabdul38 merged commit 8babfeb into Web3Novalabs:main Mar 27, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement is_pool_active helper function

2 participants